package ua.edu.nuos.jeetraining2012.automator.translator.dao;

import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import ua.edu.nuos.jeetraining2012.automator.translator.vo.InhouseEntity;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.nio.file.Path;

/**
 * @author Timur Yarosh
 *         Date: 09.06.13
 *         Time: 17:21
 */

// TODO use jaxb instead
public class InhouseDao implements IDescriptorDao<InhouseEntity> {

    @Override
    public InhouseEntity read(Path path) throws ParserConfigurationException, IOException, SAXException {
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document inhouseDocument = documentBuilder.parse(path.toFile());
        return null;
    }

    @Override
    public void write(InhouseEntity entity, Path path) {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
